//方法1：array.length--
let array = [1, 2, 3, 4, 5]
array.length--
console.log(array)  //[ 1, 2, 3, 4 ]

//方法2:
array.pop()
console.log(array)  //[ 1, 2, 3 ]

//方法3:arr.splice(arr.length - 1) 
let arr = [10, 20, 30, 40, 50]
const newArr = arr.splice(arr.length - 1)  
console.log(arr)  //[ 10, 20, 30, 40 ]
console.log(newArr)  //[ 50 ]